<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>

    localStorage.setItem('name',0);
    function login() {
        if (typeof (Storage) !== "undefined") {
            if (localStorage.clickcount) {
                localStorage.clickcount = Number(localStorage.clickcount) + 1;
            } else {
                localStorage.clickcount = 1;

            }
            document.write(localStorage.getItem('name').innerHTML=localStorage.clickcount);
        }
    }
</script>
<button id="login" onclick="login()">+</button>
</body>
</html>